package Chapter7_MultiplexingClass;

/**
 * Date: 2019/2/18
 * Time: 19:24
 * User: Driss.
 *
 * 7.8.1 final参数
 */
class Gizmo{
    public void spin(){}
}

public class FinalArguments {
    void with(final Gizmo g){
      //  g = new Gizmo(); //illegal -- g is final
    }

    void withOut(Gizmo g){
        g = new Gizmo();
        g.spin();
    }

    //Can't change,you can only read from a final primitive
    void g(final int i){
        // return i + 1;  //can't
    }

    public static void main(String[] args) {
        FinalArguments bf = new FinalArguments();
        bf.withOut(null);
        bf.with(null);
    }
}
